﻿using System.Web.Mvc;
using System.Web.Routing;

namespace ScrumBox.Web.Helpers
{
    public static class RouteConfigurator
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute("ProjectNew", "Project/New", new {controller = "Project", action = "New"});
            routes.MapRoute("ProjectSave", "Project/Save", new {controller = "Project", action = "Save"});
            routes.MapRoute("ProjectList", "Project/List", new {controller = "Project", action = "List"});
            routes.MapRoute("ProjectEdit", "Project/Edit/{key}", new {controller = "Project", action = "Edit"});
            routes.MapRoute("ProjectDetails", "Project/{key}", new {controller = "Project", action = "Details"});

            routes.MapRoute("ProductBackLogSave", "Project/BackLog/Save", new {controller = "ProductBackLog", action = "Save"});
            routes.MapRoute("ProductBackLogAdd", "Project/{projectKey}/BackLog/New", new {controller = "ProductBackLog", action = "New"});
            routes.MapRoute("ProductBackLogEdit", "Project/{projectKey}/BackLog/{backLogItem}", new {controller = "ProductBackLog", action = "Edit"});

            routes.MapRoute("SprintDetails", "Sprint/Details/{sprintKey}", new {controller = "Sprint", action = "Details"});

            routes.MapRoute("default_aspx", "Default.aspx",         new { controller = "Home", action = "Index" });
            routes.MapRoute("Root", "",                             new { controller = "Home", action = "Index" });
            routes.MapRoute("Home", "Home",                         new { controller = "Home", action = "Index" });
            routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index" });
        }
    }
}